function selectBook() {
    var name = $('#bookname').val();
    if (name.trim() == "" || name == null) {
        alert("请输入图书名！");
    } else {
        $.ajax({
            url: contextPath + "/book/select",
            data: {'name': name},
            method: "post",
            success: function (data) {
                //alert(data);
                if (data == null || data == "") {
                    alert("亲，暂时没有这本书，试试查询别的看看。")

                } else {
                    //alert(data);
                    window.location.href = contextPath + "/book/detail?id=" + data;
                }

            }
        })
    }
}

